package com.ysy.logistics.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassDescription: swagger配置类
 * @Author:姚斯羽
 * @Create:2025/3/12 14:25
 **/
@Configuration
public class Swagger3Config
{
    @Bean
    public GroupedOpenApi payApi()
    {
        return GroupedOpenApi.builder().group("用户模块").pathsToMatch("/sysUser/**").build();
    }

    @Bean
    public GroupedOpenApi dictApi()
    {
        return GroupedOpenApi.builder().group("字典").pathsToMatch("/sysDict/**").build();
    }

    @Bean
    public GroupedOpenApi fileApi()
    {
        return GroupedOpenApi.builder().group("文件模块").pathsToMatch("/file/**").build();
    }



    @Bean
    public GroupedOpenApi roleApi()
    {
        return GroupedOpenApi.builder().group("角色模块").pathsToMatch("/sysRole/**").build();
    }

    @Bean
    public GroupedOpenApi permissionsApi()
    {
        return GroupedOpenApi.builder().group("权限模块").pathsToMatch("/sysPermissions/**").build();
    }


    @Bean
    public GroupedOpenApi otherApi()
    {
        return GroupedOpenApi.builder().group("测试").pathsToMatch("/test/**").build();
    }

    @Bean
    public OpenAPI docsOpenApi()
    {
        return new OpenAPI()
                .info(new Info().title("基于物联网和大数据的智能仓储管理系统")
                        .description("后端接口文档")
                        .version("v1.0"))
                .externalDocs(new ExternalDocumentation()
                        .description("暂无")
                        .url("暂无"));
    }
}
